package com.wsx.rpc.api;

import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.io.Serializable;
import java.util.*;

/**
 * @author wangshuaixin
 * @Title: com.wsx.rpc.api.ApiRequest
 * @Description: TODO
 * @date 2018/10/30
 */
@NoArgsConstructor
public class ApiRequest implements Serializable {

    @Setter @Getter private int code;
    @Setter @Getter private String msg;
    @Setter @Getter private String name;
    @Setter @Getter private Date time = new Date();
    @Setter @Getter private Map<String, Object> map;
    @Setter @Getter private float money;
    @Setter @Getter private int status;
    @Setter @Getter private String title;
    @Setter @Getter private List<String> list;
    @Setter @Getter private long days;

    public static ApiRequest build() {
        ApiRequest apiRequest = new ApiRequest();

        apiRequest.setCode(200);
        apiRequest.setMsg("执行成功");
        apiRequest.setTime(new Date());
        apiRequest.setMap(new HashMap<>());
        apiRequest.setMoney(3.212f);
        apiRequest.setTitle("this is a title");
        apiRequest.setList(new ArrayList<>());
        apiRequest.setDays(System.currentTimeMillis());
        return apiRequest;
    }
}
